If Not AddTable(table, f.FName, f.fType, f.FSize, f.cCounter) Then
'MsgBox "Field Not Added", 64, "Data Manager"
Unload Me
Exit Sub
Else
Me.TableName = table
Me.Caption = "Table: " + table
End If
Else
If Not addField(Me.TableName, f.FName, f.fType, f.FSize, f.cCounter) Then
MsgBox "Could Not Add Field.", 64, "Data Manager"
Exit Sub
End If
End If
If Not RefreshTableFields(Me, (Me.TableName)) Then
MsgBox "Error While Refreshing Table Information. Data displayed may be incorrect.", 64, "Data Manager"
End If
End If
Unload fieldForm
End Sub
Sub Command3_Click ()
Dim x As Integer
Dim field As String
On Error Resume Next
grid1.Col = 1
field = grid1.Text
If field = "" Then
MsgBox "No Field Selected: You must select a field before it can be deleted", 64, "Data Manager"
Else
x = MsgBox("Are You Sure You Want To Delete Field: """ + field + """?", 33, "Data Manager")
If x = 1 Then
gDatabase.TableDefs.Refresh
gDatabase.TableDefs(Me.TableName).Fields.Refresh
If Err <> 0 Then
MsgBox "Error While Attempting To Refresh Table Info. Database may have been altered by another source. Displayed Information May be Incorrect:" + Chr$(13) + Error$, 64, "Data Manager"
Exit Sub
End If
gDatabase.TableDefs(Me.TableName).Fields.Delete field
If Err <> 0 Then
MsgBox "Could Not Delete Field: """ + field + Chr$(13) + Error$, 64, "Data Manager"
Exit Sub
Else
If Not RefreshTableFields(Me, (Me.TableName)) Then
MsgBox "Error While Attempting To Refresh Table Info. Displayed Information May be Incorrect:" + Chr$(13) + Error$, 64, "Data Manager"
End If
End If
End If
End If
End Sub
Sub command4_click ()
Dim TempString As String
fAddIndex.cTableName = TableName.Caption
fAddIndex.Show 1
TempString = TableName
If Not RefreshTableIndexes(Me, TempString) Then
MsgBox "Could Not Open Table:" + Chr$(13) + Error$, 64, "Data Manager"
End If
End Sub
Sub Command5_Click ()
Dim x As Integer
Dim indx As String
On Error Resume Next
grid2.Col = 1
indx = grid2.Text
If indx = "" Then
MsgBox "No Index Selected: You must select a index before it can be deleted", 64, "Data Manager"
Else
x = MsgBox("Are You Sure You Want To Delete Index: """ + indx + """?", 33, "Data Manager")
If x = 1 Then
'gDatabase.TableDefs.Refresh
'gDatabase.TableDefs(Me.TableName).Fields.Refresh
'If Err <> 0 Then
'MsgBox "Error While Attempting To Refresh Table Info. Database may have been altered by another source. Displayed Information May be Incorrect:" + Chr$(13) + Error$, 64, "Data Manager"